<%--
  Created by IntelliJ IDEA.
  User: admin
  Date: 2024/9/23
  Time: 20:23
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>


<html>
<head>
    <title>用户列表</title>
</head>
<body>
<h2>用户列表</h2>
<table>
    <tr>
        <th>编号</th>
        <th>用户名</th>
        <th>密码</th>
        <th>类型</th>
        <th>备注</th>
        <th>操作</th>
    </tr>
    <c:forEach items="${users}" var="user">
        <tr>
            <td>${user.uCode}</td>
            <td>${user.uName}</td>
            <td>${user.uPwd}</td>
            <td>${user.uType == 0? '普通' : '管理员'}</td>
            <td>${user.uMemo}</td>
            <td>
                <c:if test="${loggedInUser!= null && (loggedInUser.uCode == user.uCode || loggedInUser.uType == 1)}">
                    <a href="/demo2_war/users/add">新增</a>
                    <a href="/demo2_war/users/edit?id=${user.uCode}">修改</a>
                    <a href="/demo2_war/users/delete?id=${user.uCode}">删除</a>
                </c:if>
            </td>
        </tr>
    </c:forEach>
</table>
</body>
</html>
